package SV_WEAK_CRYPT;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.UUID;

public class Fixed_01 {
    public static UUID name;
    Object Fixed_01(byte[] name) {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            return makeUuid(md.digest(name), 3);
        } catch (NoSuchAlgorithmException e) {
            throw new AssertionError(e);
        }
    }

    private Object makeUuid(byte[] digest, int i) {
        return new UUID(digest[i], digest[i+1]);
    }

}
